{"version":3,"sources":["history.js"],"names":["BX","namespace","UNDO","REDO","INIT","RESOLVED","PENDING","MAX_ENTRIES_COUNT","isPlainObject","Landing","Utils","bind","fireCustomEvent","History","this","stack","commands","position","state","commandState","onStorage","window","registerBaseCommands","then","load","save","onInit","instance","getInstance","rootWindow","PageObject","getRootWindow","history","registerCommand","Command","id","undo","Action","editText","redo","editEmbed","editMap","editImage","editIcon","editLink","sortBlock","removeBlock","addBlock","editStyle","removeCard","addCard","updateBlockState","Promise","resolve","asyncParse","str","worker","Worker","postMessage","addEventListener","event","data","asyncStringify","obj","currentPageId","Main","err","localStorage","historyData","reject","landingData","Object","keys","forEach","key","index","push","Entry","shift","Math","min","parseInt","length","catch","all","allString","clear","removePageHistory","pageId","offset","entry","command","onUpdate","onActualize","onNewBranch","removeEntities","entities","fetchEntities","items","blocks","images","item","block","prototype","canUndo","canRedo","startIndex","deleteCount","deletedEntries","splice","entries"],"mappings":"CAAC,WACA,aAEAA,GAAGC,UAAU,cAEb,IAAIC,EAAO,OACX,IAAIC,EAAO,OACX,IAAIC,EAAO,OACX,IAAIC,EAAW,WACf,IAAIC,EAAU,UAEd,IAAIC,EAAoB,IAExB,IAAIC,EAAgBR,GAAGS,QAAQC,MAAMF,cACrC,IAAIG,EAAOX,GAAGS,QAAQC,MAAMC,KAC5B,IAAIC,EAAkBZ,GAAGS,QAAQC,MAAME,gBAQvCZ,GAAGS,QAAQI,QAAU,WAEpBC,KAAKC,SACLD,KAAKE,YACLF,KAAKG,UAAY,EACjBH,KAAKI,MAAQd,EACbU,KAAKK,aAAed,EACpBS,KAAKM,UAAYN,KAAKM,UAAUT,KAAKG,MAErCH,EAAKU,OAAQ,UAAWP,KAAKM,WAE7BE,EAAqBR,MACnBS,KAAKC,GACLD,KAAKE,GACLF,KAAKG,IAQR1B,GAAGS,QAAQI,QAAQc,SAAW,KAO9B3B,GAAGS,QAAQI,QAAQe,YAAc,WAEhC,IAAIC,EAAa7B,GAAGS,QAAQqB,WAAWC,gB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